package net.sky.oa.service.talkpark.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import net.sky.oa.dao.talkpark.TalBlogDao;
import net.sky.oa.model.TalBlog;
import net.sky.oa.service.talkpark.TalBlogService;

import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.htsoft.core.service.impl.BaseServiceImpl;

@Service
@Transactional
public class TalBlogServiceImpl extends BaseServiceImpl<TalBlog> implements TalBlogService {

	private TalBlogDao talblogdao;
	
	@Resource
	public void setDao(TalBlogDao talblogdao){
		super.setDao(talblogdao);
		this.talblogdao=talblogdao;
	}
	
	@Transactional(readOnly=true)
	public List<TalBlog> findAllTalBlog() {
		return talblogdao.findAllTalblog();
	}
	@Transactional(readOnly=true)
	public Map findTalBlogByValues(final int type,final String title,final String createtime,final int currentPage,final int lineSize) throws Exception{
		
		return talblogdao.findTalBlogByValues(type, title, createtime, currentPage, lineSize);
	}
	public List<TalBlog> findByHql(String paramString) {
		 Long id=Long.valueOf(paramString);
		 TalBlog talblog=talblogdao.get(id);
		 talblog.setContent("");
		 talblog.setPeoplecount(talblog.getPeoplecount()+1);
		 
		 talblogdao.save(talblog); 
		return null;
	}

	
}
